﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Interview_Session.aspx.vb" Inherits="wpp.Interview_Session" %>
<%@ Import Namespace="System.Data" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="imagetoolbar" content="no" />
    <link href="resources/css/jquery-ui-themes.css" type="text/css" rel="stylesheet" />
    <link href="resources/css/axure_rp_page.css" type="text/css" rel="stylesheet" />
    <link href="Lecturer_view_files/axurerp_pagespecificstyles.css" type="text/css" rel="stylesheet" />
    <link href="resources/css/StudentLecturerDraftSchedule.css" type="text/css" rel="stylesheet">
    
    <!--[if IE 6]>
<link href="Lecturer_view_files/axurerp_pagespecificstyles_ie6.css" type="text/css" rel="stylesheet">
<![endif]-->
    <script src="resources/scripts/jquery-1.4.2.min.js"></script>
    <script src="resources/scripts/jquery-ui-1.8.10.custom.min.js"></script>
    <script src="resources/scripts/axurerp_beforepagescript.js"></script>
    <script src="resources/scripts/messagecenter.js"></script>
    <script type="text/javascript">
      function data_change(field)
           {
                var check = true;
                var value = field.value; //get characters
                //check that all characters are digits, ., -, or ""
                for(var i=0;i < field.value.length; ++i)
                {
                     var new_key = value.charAt(i); //cycle through characters
                     if(((new_key < "0") || (new_key > "9")) &&
                          !(new_key == ""))
                     {
                          check = false;
                          break;
                     }
                }
                //apply appropriate colour based on value
                if(!check)
                {
                     field.style.backgroundColor = "red";
                }
                else
                {
                     field.style.backgroundColor = "white";
                }
           } 
    </script>
    <title>Lecturer View</title>
</head>
<body>
    <div class="main_container">
        <div class="header_contain">
            <div class="left_logo">
                <img alt="" src="resources/images/Top_Left.png" />
                <span>Welcome, [Name]&nbsp;&nbsp; | Logout</span>
            </div>
        </div>
        <div class="contain_body">
            <div class="Left_Menu">
                <table>
                    <tr>
                        <td class="menu_title">
                            MANAGE INFORMATION
                        </td>
                    </tr>
                    <tr>
                        <td class="menu_item">
                            Lecturer Info
                        </td>
                    </tr>
                    <tr>
                        <td class="menu_item">
                            Student Info
                        </td>
                    </tr>
                    <tr>
                        <td class="menu_item">
                            Student Interview Sessions
                        </td>
                    </tr>
                    <tr>
                        <td class="menu_title">
                            MANAGE SCHEDULE
                        </td>
                    </tr>
                    <tr>
                        <td class="menu_item">
                            Draft Schedule
                        </td>
                    </tr>
                    <tr>
                        <td class="menu_item">
                            Final Schedule
                        </td>
                    </tr>
                </table>
                <div class="menu_bottom">
                </div>
            </div>
            <div class="details_contain">
            
            <form action="Interview_Session.aspx" id="studentsessionForm" method="post">
            <input type="hidden" id="action" name="action" value="saveSession"/>
<%  Dim ds As Data.DataSet = ds_StudentSession("StudentSession")
    
    Dim OutPut As New StringBuilder("")
    Dim dt As DataTable = ds.Tables(0)
    Dim sGroup As String = ""
    
    Dim iNo As Integer = -1
    If dt.Rows.Count() > 0 Then
        Dim dr As DataRow
        For Each dr In dt.Rows
            If sGroup <> dr("WPP_Number") Then
                sGroup = dr("WPP_Number")
                If iNo <> -1 Then
                    OutPut.AppendFormat("</tbody></table>")
                End If
                iNo = 0
                OutPut.AppendFormat("<table style=""margin-top:20px"" border=""1""><tbody><tr><td colspan=""7"">")
                OutPut.AppendFormat("<table class=""menu_title"" width=""100%""><tbody>")
                OutPut.AppendFormat("<tr><td width=""30%"">")
                OutPut.AppendFormat("<strong>Group: {0}</strong></td>", dr("WPP_Number"))
                OutPut.AppendFormat("<td width=""100%""><strong>Date Time: {0} - {1}", dr("WPP_StartDateTime"), dr("WPP_EndDateTime"))
                OutPut.AppendFormat("</strong></td></tr></tbody></table>")
                OutPut.AppendFormat("</td></tr>")
                OutPut.AppendFormat("<tr><td style=""width: 40px"">No.</td><td>Student ID</td><td >Student name</td><td>Area Of Expertise</td><td >Occupation</td><td >Company</td><td>Session</td></tr>")
            End If
            iNo = iNo + 1
            OutPut.AppendFormat("<tr><td>{0}</td>", iNo)
            OutPut.AppendFormat("<td>{0}</td>", dr("Std_Number"))
            OutPut.AppendFormat("<td>{0}</td>", dr("Std_Name"))
            OutPut.AppendFormat("<td>{0}</td>", dr("Std_Expertise"))
            OutPut.AppendFormat("<td>{0}</td>", dr("Std_Position"))
            OutPut.AppendFormat("<td>{0}</td>", dr("Std_Company"))
            OutPut.AppendFormat("<td><input type='text' id='{0}_{1}' name='{0}_{2}_{1}' onkeyup=""data_change(this)""/></td></tr>", "Session", dr("Std_number"), dr("WPP_Number"))
            OutPut.AppendLine()
            
        Next
        OutPut.AppendFormat("</tbody></table>")
    End If
    Response.Write(OutPut)
%>
            <input name="saveSession" type="submit" value="Save"/>
            </form>
            </div>
            <br />
        </div>
        
        <div class="footer">
            <br />
            Developed by Incentives Team
        </div>
    </div>
</body>
</html>
